import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Router } from '@angular/router'

@Injectable({
  providedIn: 'root'
})
export class AudioService {

  constructor(
    private http: HttpClient,
    private router: Router
  ) { }


  // service 使用案例，为了方便，我只写一下做练习，等实际开发会用就可以
  getHotTopic() {
    this.http.get("http://localhost:3000/album/new").toPromise()
    .then((data:any) => {
      console.log(data);
      console.log('service 使用案例，为了方便，我只写一下做练习，等实际开发会用就可以');
      
    })
    .catch((err:any) => {console.log('失败');
    })
    
  }
}
